package com.wy._05Random.Enum;


import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
 * 英文字母枚举
 */
/**
 * @author 吴宇~
 * @motto 我亦无他，唯手熟尔。
 * @edition jdk1.8
 * @reflection 0-1 喧闹任其喧闹，自由我自为之，我自风情万种，与世无争。
 * @date 2024/11/09/14:13
 * @target 心若有所向往，何惧道阻且长
 */
public enum EnCharacterEnum {
    Capital_Letter(UnicodeFragmentEnum.Capital_Letter),
    Lowercase_Letter(UnicodeFragmentEnum.Lowercase_Letter);

    private final UnicodeFragmentEnum unicodeFragmentEnum;

    private static final int count = computerCount();
    private static final List<UnicodeFragment> unicodeFragmentList = computerUnicodeFragmentList();

    EnCharacterEnum(UnicodeFragmentEnum UnicodeFragmentEnum) {
        this.unicodeFragmentEnum = UnicodeFragmentEnum;
    }

    private static int computerCount() {
        return Arrays.stream(values()).mapToInt(value -> value.getUnicodeFragmentEnum().getUnicodeFragment().getCount()).sum();
    }

    private static List<UnicodeFragment> computerUnicodeFragmentList() {
        return Arrays.stream(values()).map(xxx -> xxx.getUnicodeFragmentEnum().getUnicodeFragment()).collect(Collectors.toList());
    }

    public UnicodeFragmentEnum getUnicodeFragmentEnum() {
        return unicodeFragmentEnum;
    }

    public static int getCount() {
        return count;
    }

    public static List<UnicodeFragment> getUnicodeFragmentList() {
        return unicodeFragmentList;
    }
}
